package com.itheima.treemap;

import java.util.TreeMap;

public class A02_TreeMapDemo2 {
    public static void main(String[] args) {
        //创建结合
        TreeMap<Student,String> tm=new TreeMap<>();

        //创建学生对象
        Student s1=new Student("zhangsan",23);
        Student s2=new Student("lisi",24);
        Student s3=new Student("wangwu",25);

        //添加数据
        tm.put(s1,"江苏");
        tm.put(s2,"北京");
        tm.put(s3,"重庆");

        //打印集合
        System.out.println(tm);
    }
}
